package autowired.controller;

import autowired.controller.UserController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.testng.annotations.Test;

public class TestUserController {
    @Test
    public void TestUserController(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        UserController userController = context.getBean(UserController.class);
        userController.add();
    }
}
/*
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'userController':
Unsatisfied dependency expressed through field 'userService':
Error creating bean with name 'userServiceImpl':
Unsatisfied dependency expressed through field 'userDao':
No qualifying bean of type 'autowired.dao.UserDao' available:
expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true),
 @org.springframework.beans.factory.annotation.Qualifier("UserRedisDaoImpl")}
 */